package com.firwood.lifecycle;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class LifeCycleTest {
	@Test
	public void test01(){
		//
		String xmlPath= "com/firwood/lifecycle/beans.xml";
		ApplicationContext applicationContext = new ClassPathXmlApplicationContext(xmlPath);
		//ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(xmlPath);
		Inner inner = applicationContext.getBean("InnerId",Inner.class);
		inner.save();
		
		//applicationContext.close();
		
		try{
		applicationContext.getClass().getMethod("close", null).invoke(applicationContext, null);
		}catch(Exception e){e.printStackTrace();}
		
		
		
	}
}
